#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    // 整型
    cout << "int 类型所占内存空间为： " << sizeof(int) << endl;
    cout << "long 类型所占内存空间为： " << sizeof(long) << endl;
    cout << "long long 类型所占内存空间为： " << sizeof(long long) << endl;
    cout << "====================================================" << endl;

    // 浮点型
    float f1 = 3.14f;
    double d1 = 3.14;

    cout << "f1=" << f1 << " d1=" << d1 << endl;
    cout << "float sizeof=" << sizeof(f1) << "; double sizeof=" << sizeof(d1) << endl;

    float f2 = 3e2; // 3 * 10 ^ 2 
    float f3 = 3e-2;  // 3 * 0.1 ^ 2
    cout << "f2=" << f2 << " f3=" << f3 << endl;
    cout << "====================================================" << endl;

    // 问号运算符
    int a = 10, b = 20, c = 0;
    c = a > b ? a : b;
    cout << "c = " << c << endl;

    // C++中三目运算符返回的是变量,可以继续赋值
    (a > b ? a : b) = 100;
    cout << "a=" << a << "; b=" << b << "; c=" << c << endl;
    return 0;
}
